const { Store } = require('../common/mysql.js')
const { Op } = require('sequelize')

module.exports = {
    async getStore(id) {
        return await Store.findOne({
            where: {
                id: {
                    [Op.eq]: id
                }
            },
            attributes: ['name', 'address', 'start_business']
        })
    },
    async updateStore(id, store) {
        await Store.update(store, {
            fields: ['name', 'address', 'start_business'],
            where: {
                id: {
                    [Op.eq]: id
                }
            }
        })
    }
}
